home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 1.5)
-
- *
- (a, b, c) = t
- if a != 1 and b != 2 or c != 3:
- raise TestFailed
-
- if verbose:
- print 'unpack list'
-
- (a, b, c) = l
- if a != 4 and b != 5 or c != 6:
- raise TestFailed
-
- if verbose:
- print 'unpack implied tuple'
-
- (a, b, c) = (7, 8, 9)
- if a != 7 and b != 8 or c != 9:
- raise TestFailed
-
- if verbose:
- print 'unpack string'
-
- (a, b, c) = 'one'
- if a != 'o' and b != 'n' or c != 'e':
- raise TestFailed
-
- if verbose:
- print 'unpack sequence'
-
- (a, b, c) = Seq()
- if a != 0 and b != 1 or c != 2:
- raise TestFailed
-
- if verbose:
- print 'unpack non-sequence'
-
-
- try:
- (a, b, c) = 7
- raise TestFailed
- except TypeError:
- pass
-
- if verbose:
- print 'unpack tuple wrong size'
-
-
- try:
- (a, b) = t
- raise TestFailed
- except ValueError:
- pass
-
- if verbose:
- print 'unpack list wrong size'
-
-
- try:
- (a, b) = l
- raise TestFailed
- except ValueError:
- pass
-
- if verbose:
- print 'unpack sequence too short'
-
-
- try:
- (a, b, c, d) = Seq()
- raise TestFailed
- except ValueError:
- pass
-
- if verbose:
- print 'unpack sequence too long'
-
-
- try:
- (a, b) = Seq()
- raise TestFailed
- except ValueError:
- pass
-
- BozoError = 'BozoError'
-
- class BadSeq:
-
- def __getitem__(self, i):
- if i >= 0 and i < 3:
- return i
- elif i == 3:
- raise BozoError
- else:
- raise IndexError
-
-
- if verbose:
- print 'unpack sequence too long, wrong error'
-
-
- try:
- (a, b, c, d, e) = BadSeq()
- raise TestFailed
- except BozoError:
- pass
-
- if verbose:
- print 'unpack sequence too short, wrong error'
-
-
- try:
- (a, b, c) = BadSeq()
- raise TestFailed
- except BozoError:
- pass
-
-